﻿CREATE TABLE [dbo].[ProcessDefinitions] (
    [ProcessDefinitionId]          BIGINT NOT NULL,
    [ProcessDefinitionName]        NVARCHAR (250)  NOT NULL,
    [ProcessDefinitionDescription] NVARCHAR (1000) NOT NULL,
    [SLA]                          BIGINT          NOT NULL,
    [WorkflowXaml]                 NVARCHAR (255)  NOT NULL,
    [ProcessDefinitionGroupId] BIGINT NOT NULL, 
    CONSTRAINT [PK_ProcessDefinitions] PRIMARY KEY CLUSTERED ([ProcessDefinitionId] ASC), 
    CONSTRAINT [FK_ProcessDefinitions_ToProcessDefinitionGroups] FOREIGN KEY ([ProcessDefinitionGroupId]) REFERENCES [dbo].[ProcessDefinitionGroups]([ProcessDefinitionGroupId])
);


GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_ProcessDefinitions_UniqueName]
    ON [dbo].[ProcessDefinitions]([ProcessDefinitionName] ASC);

